<?php
// $Id$
/**
 * This file contains {@link Event} which is part of the PHP Content 
 * Repository (phpCR), a derivative of the Java Content Repository JSR-170,  
 * and is licensed under the Apache License, Version 2.0.
 *
 * This file is based on the code created for
 * {@link http://www.jcp.org/en/jsr/detail?id=170 JSR-170}
 *
 * @author Travis Swicegood <travis@domain51.net>
 * @copyright PHP Code Copyright &copy; 2004-2005, Domain51, United States
 * @copyright Original Java and Documentation 
 *  Copyright &copy; 2002-2004, Day Management AG, Switerland
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, 
 *      Version 2.0
 * @package phpContentRepository
 * @subpackage Level2
 */

/**
 * Load the {@link phpCR} library file(s)
 */ 
require_once(dirname(__FILE__) . '/../phpCR.library.php');
phpCR::loadInterface('Item');
phpCR::loadInterface('Ticket');


/**
 * All events used by the {@link ObservationManager} system are subclassed from 
 * this interface.
 *
 * Level 2 only
 *
 * For details see the {@link ObservationManager} section of the phpCR/JCR 
 * standard document.
 *
 * @author PHP - Travis Swicegood <travis@domain51.net>
 * @copyright Copyright &copy; 2004-2005, Domain51
 * @package phpContentRepository
 * @subpackage Level2
 */
interface Event 
{
   /**
    * Returns the type of this event. One of:
    * <ul>
    *   <li>{@link EventType::ITEM_ADDED}</li>
    *   <li>{@link EventType::ITEM_CHANGED}</li>
    *   <li>{@link EventType::ITEM_REMOVED}</li>
    *   <li>{@link EventType::ITEM_VERSIONED}</li>
    *   <li>{@link EventType::LABEL_ADDED}</li>
    *   <li>{@link EventType::LABEL_REMOVED}</li>
    *   <li>{@link EventType::ITEM_LOCKED}</li>
    *   <li>{@link EventType::ITEM_UNLOCKED}</li>
    *   <li>{@link EventType::LOCK_EXPIRED}</li>
    * </ul>
    *
    * @return int
    */
    public function getType();
    
    
   /**
    * Returns the {@link Item} connected with this {@link Event}.
    *
    * @return object
    *   An {@link Item}.
    */
    public function getItem();
    
    
   /**
    * Returns the {@link Ticket} connected with this {@link Event}.
    *
    * @return object
    *   A {@link Ticket}.
    */
    public function getTicket();
}

